import Vue from "vue";
import VueRouter from "vue-router";
import HomePage from "../views/HomePage.vue"
import Main from "../components/teacher/Main.vue"
import Course from "../components/teacher/Course.vue"
import User from "../components/teacher/User.vue"
import Clazz from "../components/teacher/Clazz.vue"
import Term from "../components/teacher/Term.vue"
Vue.use(VueRouter);

const routes = [{
        path: "/",
        name: "home",
        component: HomePage,
        redirect: "/main",
        children: [{
                path: "/main",
                component: Main,
            }, {
                path: "/course",
                component: Course,
            }, {
                path: "/user",
                component: User,
            }, {
                path: "/clazz",
                component: Clazz,
            }, {
                path: "/term",
                component: Term,
            }
            // {
            //     path: "/term",
            //     component: () =>
            //         import ('../components/teacher/Term.vue'),
            // }
        ]
    }

];

const router = new VueRouter({
    mode: "history",
    base: process.env.BASE_URL,
    routes
});

export default router;